Skip to content

feat(server): Support removing tools, prompts and resources #85

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

134130
Copy link

@134130 134130 commented Apr 24, 2025

Motivation and Context

  • Add support for removing tools, prompts and resources.
  • Currently, the SDK only supports adding APIs.

How Has This Been Tested?

  • With Unit Tests.

Breaking Changes

  • No.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@134130 134130 changed the title Add removing APIs for tools, prompts and resources feat(server): Support removing tools, prompts and resources Apr 24, 2025
@e5l e5l requested review from Copilot and e5l April 29, 2025 12:14
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

A PR to add support for removing tools, prompts, and resources from the SDK server. Key changes include new functions to remove a single or multiple items with appropriate capability checks and logging.

  • Added removeTool and removeTools functions for tool removal.
  • Added removePrompt and removePrompts functions for prompt removal.
  • Added removeResource and removeResources functions for resource removal.
Files not reviewed (1)
  • api/kotlin-sdk.api: Language not supported

Copy link
Contributor

@e5l e5l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @134130, thanks for the PR.

Could you tell me the reason for the change? I'm not sure I understand the use case

@134130
Copy link
Author

134130 commented Apr 29, 2025

Hi @e5l, sorry for my lack of description.

The MCP is designed on the user's context. That is the reason why the client supports root API. For example:

  • The server can provide directories based on user's root context

Also, there is a tool-list changed notifications channel. Which means the MCP Server is designed as the tools(resources, prompts) can be changed anytime.

So, there is no reason to restrict server providers from removing the tool, and that makes it difficult for me to make the rich MCP API for the users.

@e5l
Copy link
Contributor

e5l commented Apr 29, 2025

That's a valid use case. If you want this use case to be fully supported, please consider writing a separate PR with documentation of it

@e5l e5l enabled auto-merge (squash) April 29, 2025 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants